package com.example.communitypro.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

public class CommunityInformation implements Serializable {
    private Integer communityNo;

    private String communityName;

    private String communityLcon;

    private Integer communityMember;

    private String communitySynopsis;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date communityCreationTime;

    private Integer communityPostNumber;

    private Integer communityLikeNumber;

    private Integer communityClickNumber;

    private Integer communityCollectionNumber;

    private static final long serialVersionUID = 1L;

    public Integer getCommunityNo() {
        return communityNo;
    }

    public void setCommunityNo(Integer communityNo) {
        this.communityNo = communityNo;
    }

    public String getCommunityName() {
        return communityName;
    }

    public void setCommunityName(String communityName) {
        this.communityName = communityName == null ? null : communityName.trim();
    }

    public String getCommunityLcon() {
        return communityLcon;
    }

    public void setCommunityLcon(String communityLcon) {
        this.communityLcon = communityLcon == null ? null : communityLcon.trim();
    }

    public Integer getCommunityMember() {
        return communityMember;
    }

    public void setCommunityMember(Integer communityMember) {
        this.communityMember = communityMember;
    }

    public String getCommunitySynopsis() {
        return communitySynopsis;
    }

    public void setCommunitySynopsis(String communitySynopsis) {
        this.communitySynopsis = communitySynopsis == null ? null : communitySynopsis.trim();
    }

    public Date getCommunityCreationTime() {
        return communityCreationTime;
    }

    public void setCommunityCreationTime(Date communityCreationTime) {
        this.communityCreationTime = communityCreationTime;
    }

    public Integer getCommunityPostNumber() {
        return communityPostNumber;
    }

    public void setCommunityPostNumber(Integer communityPostNumber) {
        this.communityPostNumber = communityPostNumber;
    }

    public Integer getCommunityLikeNumber() {
        return communityLikeNumber;
    }

    public void setCommunityLikeNumber(Integer communityLikeNumber) {
        this.communityLikeNumber = communityLikeNumber;
    }

    public Integer getCommunityClickNumber() {
        return communityClickNumber;
    }

    public void setCommunityClickNumber(Integer communityClickNumber) {
        this.communityClickNumber = communityClickNumber;
    }

    public Integer getCommunityCollectionNumber() {
        return communityCollectionNumber;
    }

    public void setCommunityCollectionNumber(Integer communityCollectionNumber) {
        this.communityCollectionNumber = communityCollectionNumber;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        CommunityInformation other = (CommunityInformation) that;
        return (this.getCommunityNo() == null ? other.getCommunityNo() == null : this.getCommunityNo().equals(other.getCommunityNo()))
                && (this.getCommunityName() == null ? other.getCommunityName() == null : this.getCommunityName().equals(other.getCommunityName()))
                && (this.getCommunityLcon() == null ? other.getCommunityLcon() == null : this.getCommunityLcon().equals(other.getCommunityLcon()))
                && (this.getCommunityMember() == null ? other.getCommunityMember() == null : this.getCommunityMember().equals(other.getCommunityMember()))
                && (this.getCommunitySynopsis() == null ? other.getCommunitySynopsis() == null : this.getCommunitySynopsis().equals(other.getCommunitySynopsis()))
                && (this.getCommunityCreationTime() == null ? other.getCommunityCreationTime() == null : this.getCommunityCreationTime().equals(other.getCommunityCreationTime()))
                && (this.getCommunityPostNumber() == null ? other.getCommunityPostNumber() == null : this.getCommunityPostNumber().equals(other.getCommunityPostNumber()))
                && (this.getCommunityLikeNumber() == null ? other.getCommunityLikeNumber() == null : this.getCommunityLikeNumber().equals(other.getCommunityLikeNumber()))
                && (this.getCommunityClickNumber() == null ? other.getCommunityClickNumber() == null : this.getCommunityClickNumber().equals(other.getCommunityClickNumber()))
                && (this.getCommunityCollectionNumber() == null ? other.getCommunityCollectionNumber() == null : this.getCommunityCollectionNumber().equals(other.getCommunityCollectionNumber()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getCommunityNo() == null) ? 0 : getCommunityNo().hashCode());
        result = prime * result + ((getCommunityName() == null) ? 0 : getCommunityName().hashCode());
        result = prime * result + ((getCommunityLcon() == null) ? 0 : getCommunityLcon().hashCode());
        result = prime * result + ((getCommunityMember() == null) ? 0 : getCommunityMember().hashCode());
        result = prime * result + ((getCommunitySynopsis() == null) ? 0 : getCommunitySynopsis().hashCode());
        result = prime * result + ((getCommunityCreationTime() == null) ? 0 : getCommunityCreationTime().hashCode());
        result = prime * result + ((getCommunityPostNumber() == null) ? 0 : getCommunityPostNumber().hashCode());
        result = prime * result + ((getCommunityLikeNumber() == null) ? 0 : getCommunityLikeNumber().hashCode());
        result = prime * result + ((getCommunityClickNumber() == null) ? 0 : getCommunityClickNumber().hashCode());
        result = prime * result + ((getCommunityCollectionNumber() == null) ? 0 : getCommunityCollectionNumber().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", communityNo=").append(communityNo);
        sb.append(", communityName=").append(communityName);
        sb.append(", communityLcon=").append(communityLcon);
        sb.append(", communityMember=").append(communityMember);
        sb.append(", communitySynopsis=").append(communitySynopsis);
        sb.append(", communityCreationTime=").append(communityCreationTime);
        sb.append(", communityPostNumber=").append(communityPostNumber);
        sb.append(", communityLikeNumber=").append(communityLikeNumber);
        sb.append(", communityClickNumber=").append(communityClickNumber);
        sb.append(", communityCollectionNumber=").append(communityCollectionNumber);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}